<?php require './view/public/header.php'; ?>
    <!--/sidebar-->
    <div class="main-wrap">
        <div class="search-wrap">
            <div class="search-content">
                <form action="./index.php?c=user&a=index">
                    <table class="search-tab">
						<tr>
							<td>UID</td><td>订单ID</td><td>金额</td><td>收货人</td><td>收货地址</td><td>联系电话</td><td>下单时间</td><td>状态</td><td>操作</td>
						</tr>
						<?php
							if(empty($ret)){die;}
							$_GET['tblname'] = 'shop_addr';
							$_GET['pk'] = 'uid';
							$status = ['未付款','待发货','已发货','已收货'];
							foreach($ret as $v){
								$addr = select(" WHERE uid=$v[uid]")[0];
								
								$_GET['tblname'] = 'shop_users';
								$_GET['pk'] = 'uid';
								$name = select(" WHERE uid=$v[uid] ")[0];
						  echo "<tr>
								<td>$name[uname]</td>
								<td>$v[oid]</td>
								<td>$v[ormb]</td>
								<td>$addr[name]</td>
								<td>".$addr['prov'].$addr['city'].$addr['dist'].$addr['addr']."</td>
								<td>$addr[tel]</td>
								<td>".date('Y-m-d H:i:s',$v['otime'])."</td>
								<td>".$status[$v['status']]."</td>
								<td><a href='./index.php?c=dd&a=status&act=1&id=$v[oid]'>待发货</a> &nbsp; <a href='./index.php?c=dd&a=status&act=2&id=$v[oid]'>已发货</a></td>
								</tr>";
							}
						?>
                    </table>
                    <div class="list-page">
						<?php
							echo "<a href='./index.php?c=dd&a=index&nowPage=1'>首页</a>";
							echo "<a href='./index.php?c=dd&a=index&nowPage=$prevPage'>上一页</a>";
							echo " &nbsp; $allRows 条 $nowPage/$allPage 页 &nbsp; ";
							echo "<a href='./index.php?c=dd&a=index&nowPage=$nextPage'>下一页</a>";
							echo "<a href='./index.php?c=dd&a=index&nowPage=$allPage'>尾页</a>";
						?>
					</div>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
<?php require './view/public/footer.php'; ?>